<template>
  <div>
    <h3>父组件--{{ num }}</h3>
    <button @click="doClick">绑定事件</button>
    <!-- <son :value="num" @input="val => num = val" /> -->
    <!-- v-model是一个语法糖, 写法相当于
    <son :value="num" @input="val => num = val" />
      注意点: v-model在同一个组件上只能绑定一次
     -->
    <son v-model="num" />
  </div>
</template>

<script>
import son from './son.vue'
export default {
  components: { son },
  data() {
    return {
      num: 100
    }
  },
  methods: {
    doClick() {
      this.num++
    }
  }
}
</script>

<style>

</style>
